<?php
class DataStaffWorkExperienceAction extends CommonAction {
    
    protected $_str_model           = 'DataStaffWorkExperience';
    protected $_arr_search          = array(
                                            'staff_id'       => array('IN', '?', 'str'),
                                            'staff_name'     => array('LIKE', '%?%', 'str'),
                                            'company_name'   => array('LIKE', '%?%', 'str'),
                                            'remark'         => array('LIKE', '%?%', 'str'),
                                            'status'         => array('EQ', '?', 'int'),
                                      );
                   
    /**
     * Search before
     * 
     * @param  void
     * @return void
     * @author andy
     */
    public function before_search() {

        if ( ! $this->_post('staff_id') ) {
            set_post('staff_id', D('DataStaffBasic')->get_pk_by_name($this->_post('staff_name'), 'staff_name'), false);
        }
    }
    
    /**
     * Before do action
     * for edit, add
     * 
     * @param  void
     * @return void
     * @author andy
     */
    public function before_do_action() {

        set_post('staff_id', $this->_post('data_staff_basic_staff_id'), false);
    }
}